/**
 * 
 */
package Consult.view;

import java.awt.EventQueue;

import javax.swing.JInternalFrame;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.UIManager;
import java.awt.SystemColor;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.border.LineBorder;
import javax.swing.ImageIcon;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

/**
 * @author zhaoyana
 *
 */
public class interBookTypeAdd extends JInternalFrame {

	private JTextArea booktypeNametxt;
	private JTextArea bookTypeDesctxtx;
	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					interBookTypeAdd frame = new interBookTypeAdd();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public interBookTypeAdd() {
		setFrameIcon(new ImageIcon(interBookTypeAdd.class.getResource("/images/图书馆1.png")));
		getContentPane().setBackground(SystemColor.inactiveCaption);
		setIconifiable(true);
		setClosable(true);
		setBounds(100, 100, 666, 527);
		
		JLabel lblNewLabel = new JLabel("图书类别名称");
		lblNewLabel.setIcon(new ImageIcon(interBookTypeAdd.class.getResource("/images/名称-档案设置.png")));
		lblNewLabel.setBackground(SystemColor.inactiveCaption);
		lblNewLabel.setFont(new Font("Dialog", Font.PLAIN, 25));
		
		booktypeNametxt = new JTextArea();
		
		JLabel lblNewLabel_1 = new JLabel("图书类别介绍");
		lblNewLabel_1.setIcon(new ImageIcon(interBookTypeAdd.class.getResource("/images/描述.png")));
		lblNewLabel_1.setFont(new Font("Dialog", Font.PLAIN, 25));
		
		JTextArea bookTypeDesctxtx = new JTextArea();
		
		JButton btnNewButton = new JButton("确定添加");
		btnNewButton.setIcon(new ImageIcon(interBookTypeAdd.class.getResource("/images/确定.png")));
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			
			}

			
			
		});
		btnNewButton.setFont(new Font("Dialog", Font.PLAIN, 25));
		
		JButton btnNewButton_1 = new JButton("取消");
		btnNewButton_1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				resetValueActionPerformed(e);
			}
		});
		btnNewButton_1.setIcon(new ImageIcon(interBookTypeAdd.class.getResource("/images/取消.png")));
		btnNewButton_1.setFont(new Font("Dialog", Font.PLAIN, 25));
		GroupLayout groupLayout = new GroupLayout(getContentPane());
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addContainerGap()
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addComponent(lblNewLabel)
						.addComponent(lblNewLabel_1))
					.addGap(29)
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addComponent(bookTypeDesctxtx, GroupLayout.PREFERRED_SIZE, 376, GroupLayout.PREFERRED_SIZE)
						.addComponent(booktypeNametxt, GroupLayout.PREFERRED_SIZE, 369, GroupLayout.PREFERRED_SIZE))
					.addContainerGap(83, Short.MAX_VALUE))
				.addGroup(groupLayout.createSequentialGroup()
					.addGap(109)
					.addComponent(btnNewButton)
					.addPreferredGap(ComponentPlacement.RELATED, 213, Short.MAX_VALUE)
					.addComponent(btnNewButton_1, GroupLayout.PREFERRED_SIZE, 128, GroupLayout.PREFERRED_SIZE)
					.addGap(67))
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addGap(34)
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addComponent(booktypeNametxt, GroupLayout.PREFERRED_SIZE, 35, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblNewLabel))
					.addGap(18)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblNewLabel_1)
						.addComponent(bookTypeDesctxtx, GroupLayout.PREFERRED_SIZE, 266, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(ComponentPlacement.RELATED, 54, Short.MAX_VALUE)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(btnNewButton)
						.addComponent(btnNewButton_1))
					.addGap(47))
		);
		getContentPane().setLayout(groupLayout);

	
//		bookTypeDesctxt.setBorder(new LineBorder(new java.awt.Color(127,157,185), 1, false));
	}
	private void resetValueActionPerformed(ActionEvent evt) {
		this.resetValue();// 重置事件处理
	
		
	}
	/**
	 * 把重置抽象出来成一个方法
	 * 
	 */
	private void resetValue() {
		this.booktypeNametxt.setText("");
		this.bookTypeDesctxtx.setText("");
	}
}
